<?php

use think\migration\Seeder;

use think\facade\Db;

class Clause extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run(): void
    {
        if (!Db::name('clause')->count()) {
            $data = [[
                'title' => '用户协议',
                'content' => '<h1><strong>用户服务协议</strong></h1>',
                'status' => 1,
                'create_time' => time(),
            ], [
                'title' => '隐私政策',
                'content' => '<h1><strong>隐私政策</strong></h1>',
                'status' => 1,
                'create_time' => time(),
            ], [
                'title' => '使用帮助',
                'content' => '<h1><strong>使用帮助</strong></h1>',
                'status' => 1,
                'create_time' => time(),
            ], [
                'title' => '退换货政策',
                'content' => '<h1><strong>退换货政策</strong></h1>',
                'status' => 1,
                'create_time' => time(),
            ]];
            Db::name('clause')->insertAll($data);
        }
    }
}
